package com.nali.spreader.model;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.nali.common.model.BaseModel;

public class RegularJob extends BaseModel implements Serializable {

	public static final Integer TRIGGER_TYPE_SIMPLE = 1;

	public static final Integer TRIGGER_TYPE_CRON = 2;

	private static final long serialVersionUID = 1340715782719822254L;

	public static class TriggerDto {

		private String description;

		private Integer triggerType;

		private String remind;

		private String cron;

		private Date start;

		private int repeatTimes;

		private int repeatInternal;

		public String getDescription() {
			return description;
		}

		public void setDescription(String description) {
			this.description = description;
		}

		public Integer getTriggerType() {
			return triggerType;
		}

		public void setTriggerType(Integer triggerType) {
			this.triggerType = triggerType;
		}

		public String getCron() {
			return cron;
		}

		public void setCron(String cron) {
			this.cron = cron;
		}

		public Date getStart() {
			return start;
		}

		public void setStart(Date start) {
			this.start = start;
		}

		public int getRepeatTimes() {
			return repeatTimes;
		}

		public void setRepeatTimes(int repeatTimes) {
			this.repeatTimes = repeatTimes;
		}

		public int getRepeatInternal() {
			return repeatInternal;
		}

		public void setRepeatInternal(int repeatInternal) {
			this.repeatInternal = repeatInternal;
		}

		public String getRemind() {
			return remind;
		}

		public void setRemind(String remind) {
			this.remind = remind;
		}
		
		public String toString() {
			return ToStringBuilder.reflectionToString(this,
					ToStringStyle.SHORT_PREFIX_STYLE);
		}
	}

	private TriggerDto triggerObject;

	private Object configObject;

	private Object extendConfigObject;

	public Object getConfigObject() {
		return configObject;
	}

	public void setConfigObject(Object configObject) {
		this.configObject = configObject;
	}

	public Object getExtendConfigObject() {
		return extendConfigObject;
	}

	public void setExtendConfigObject(Object extendConfigObject) {
		this.extendConfigObject = extendConfigObject;
	}

	public TriggerDto getTriggerObject() {
		return triggerObject;
	}

	public void setTriggerObject(TriggerDto triggerObject) {
		this.triggerObject = triggerObject;
	}

	/**
	 * This field was generated by Apache iBATIS ibator. This field corresponds
	 * to the database column spreader.tb_regular_job.id
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	private Long id;

	/**
	 * This field was generated by Apache iBATIS ibator. This field corresponds
	 * to the database column spreader.tb_regular_job.name
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	private String name;

	/**
	 * This field was generated by Apache iBATIS ibator. This field corresponds
	 * to the database column spreader.tb_regular_job.trigger_type
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	private Integer triggerType;

	/**
	 * This field was generated by Apache iBATIS ibator. This field corresponds
	 * to the database column spreader.tb_regular_job.trigger_info
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	private String triggerInfo;

	/**
	 * This field was generated by Apache iBATIS ibator. This field corresponds
	 * to the database column spreader.tb_regular_job.description
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	private String description;

	/**
	 * This field was generated by Apache iBATIS ibator. This field corresponds
	 * to the database column spreader.tb_regular_job.job_type
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	private Integer jobType;

	/**
	 * This field was generated by Apache iBATIS ibator. This field corresponds
	 * to the database column spreader.tb_regular_job.gid
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	private Long gid;

	/**
	 * This field was generated by Apache iBATIS ibator. This field corresponds
	 * to the database column spreader.tb_regular_job.gname
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	private String gname;

	/**
	 * This field was generated by Apache iBATIS ibator. This field corresponds
	 * to the database column spreader.tb_regular_job.extend_type
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	private String extendType;

	/**
	 * This field was generated by Apache iBATIS ibator. This field corresponds
	 * to the database column spreader.tb_regular_job.extend_config
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	private String extendConfig;

	/**
	 * This field was generated by Apache iBATIS ibator. This field corresponds
	 * to the database column spreader.tb_regular_job.ref_id
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	private Long refId;

	/**
	 * This field was generated by Apache iBATIS ibator. This field corresponds
	 * to the database column spreader.tb_regular_job.config
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	private String config;

	/**
	 * This method was generated by Apache iBATIS ibator. This method returns
	 * the value of the database column spreader.tb_regular_job.id
	 * 
	 * @return the value of spreader.tb_regular_job.id
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public Long getId() {
		return id;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method sets the
	 * value of the database column spreader.tb_regular_job.id
	 * 
	 * @param id
	 *            the value for spreader.tb_regular_job.id
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method returns
	 * the value of the database column spreader.tb_regular_job.name
	 * 
	 * @return the value of spreader.tb_regular_job.name
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public String getName() {
		return name;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method sets the
	 * value of the database column spreader.tb_regular_job.name
	 * 
	 * @param name
	 *            the value for spreader.tb_regular_job.name
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method returns
	 * the value of the database column spreader.tb_regular_job.trigger_type
	 * 
	 * @return the value of spreader.tb_regular_job.trigger_type
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public Integer getTriggerType() {
		return triggerType;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method sets the
	 * value of the database column spreader.tb_regular_job.trigger_type
	 * 
	 * @param triggerType
	 *            the value for spreader.tb_regular_job.trigger_type
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public void setTriggerType(Integer triggerType) {
		this.triggerType = triggerType;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method returns
	 * the value of the database column spreader.tb_regular_job.trigger_info
	 * 
	 * @return the value of spreader.tb_regular_job.trigger_info
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public String getTriggerInfo() {
		return triggerInfo;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method sets the
	 * value of the database column spreader.tb_regular_job.trigger_info
	 * 
	 * @param triggerInfo
	 *            the value for spreader.tb_regular_job.trigger_info
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public void setTriggerInfo(String triggerInfo) {
		this.triggerInfo = triggerInfo;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method returns
	 * the value of the database column spreader.tb_regular_job.description
	 * 
	 * @return the value of spreader.tb_regular_job.description
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method sets the
	 * value of the database column spreader.tb_regular_job.description
	 * 
	 * @param description
	 *            the value for spreader.tb_regular_job.description
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method returns
	 * the value of the database column spreader.tb_regular_job.job_type
	 * 
	 * @return the value of spreader.tb_regular_job.job_type
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public Integer getJobType() {
		return jobType;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method sets the
	 * value of the database column spreader.tb_regular_job.job_type
	 * 
	 * @param jobType
	 *            the value for spreader.tb_regular_job.job_type
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public void setJobType(Integer jobType) {
		this.jobType = jobType;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method returns
	 * the value of the database column spreader.tb_regular_job.gid
	 * 
	 * @return the value of spreader.tb_regular_job.gid
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public Long getGid() {
		return gid;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method sets the
	 * value of the database column spreader.tb_regular_job.gid
	 * 
	 * @param gid
	 *            the value for spreader.tb_regular_job.gid
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public void setGid(Long gid) {
		this.gid = gid;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method returns
	 * the value of the database column spreader.tb_regular_job.gname
	 * 
	 * @return the value of spreader.tb_regular_job.gname
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public String getGname() {
		return gname;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method sets the
	 * value of the database column spreader.tb_regular_job.gname
	 * 
	 * @param gname
	 *            the value for spreader.tb_regular_job.gname
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public void setGname(String gname) {
		this.gname = gname;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method returns
	 * the value of the database column spreader.tb_regular_job.extend_type
	 * 
	 * @return the value of spreader.tb_regular_job.extend_type
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public String getExtendType() {
		return extendType;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method sets the
	 * value of the database column spreader.tb_regular_job.extend_type
	 * 
	 * @param extendType
	 *            the value for spreader.tb_regular_job.extend_type
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public void setExtendType(String extendType) {
		this.extendType = extendType;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method returns
	 * the value of the database column spreader.tb_regular_job.extend_config
	 * 
	 * @return the value of spreader.tb_regular_job.extend_config
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public String getExtendConfig() {
		return extendConfig;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method sets the
	 * value of the database column spreader.tb_regular_job.extend_config
	 * 
	 * @param extendConfig
	 *            the value for spreader.tb_regular_job.extend_config
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public void setExtendConfig(String extendConfig) {
		this.extendConfig = extendConfig;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method returns
	 * the value of the database column spreader.tb_regular_job.ref_id
	 * 
	 * @return the value of spreader.tb_regular_job.ref_id
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public Long getRefId() {
		return refId;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method sets the
	 * value of the database column spreader.tb_regular_job.ref_id
	 * 
	 * @param refId
	 *            the value for spreader.tb_regular_job.ref_id
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public void setRefId(Long refId) {
		this.refId = refId;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method returns
	 * the value of the database column spreader.tb_regular_job.config
	 * 
	 * @return the value of spreader.tb_regular_job.config
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public String getConfig() {
		return config;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method sets the
	 * value of the database column spreader.tb_regular_job.config
	 * 
	 * @param config
	 *            the value for spreader.tb_regular_job.config
	 * 
	 * @ibatorgenerated Mon Jul 23 13:48:27 CST 2012
	 */
	public void setConfig(String config) {
		this.config = config;
	}
	
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.SHORT_PREFIX_STYLE);
	}
}
